// BaseRepository.java
package com.example.orderfood2.Repository;

import android.content.ContentValues;
import android.content.Context;
import android.database.Cursor;
import android.database.sqlite.SQLiteDatabase;

import com.example.orderfood2.DBHelper.DBHelper;


public class BaseRepository {
    protected DBHelper dbHelper;
    protected SQLiteDatabase database;

    public BaseRepository(Context context) {
        dbHelper = new DBHelper(context);
    }

    protected void open() {
        database = dbHelper.getWritableDatabase();
    }

    public void close() {
        if (database != null && database.isOpen()) {
            database.close();
        }
    }

    protected ContentValues createContentValues() {
        return new ContentValues();
    }
}